<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./Tpl/css/bootstrap.min.css">
	<style type="text/css">
		.main{
			padding-top: 100px;
		}
		.form-inline textarea.content{
			width: 100%;
			margin-top: 20px;
		}

	</style>
</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
            data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">
                    Toggle navigation
                </span>
                <span class="icon-bar">
                </span>
                <span class="icon-bar">
                </span>
                <span class="icon-bar">
                </span>
            </button>
            <a class="navbar-brand" href="#">
                留言板
            </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active">
                    <a href="#">
                        Home
                    </a>
                </li>
                
            </ul>
        </div>
        <!--/.nav-collapse -->
    </div>

</nav>
	<div class="col-md-12 main">

		<?php foreach ($db as $k => $v) { ?>
			<div class="alert <?php echo $color[array_rand($color)] ?>" role="alert">
			    <strong>
			        <?php echo $v['username'] ?>
			    </strong>
			    <?php echo $v['content'] ?>（<?php echo date('Y-m-d H:i:s',$v['create_time']) ?>）
			    <a href="./del.php?id=<?php echo $k ?>">删除</a>
			    <a href="./edit.php?id=<?php echo $k ?>">修改</a>
			</div>

		<?php } ?>
	</div>
	<div class="col-md-12">
		<form class="form-inline" method="post" action="./add.php">
		  <div class="col-md-12">
			  	<div class="form-group">
			    <label for="exampleInputName2">用户名</label>
			    <input type="text" class="form-control" id="exampleInputName2"name="username" placeholder="Jane Doe">
			  </div>
			  <button type="submit" class="btn btn-success">留言</button>
		  </div>
		  <div class="col-md-12">
		  	<textarea class="form-control content" name="content" rows="3"></textarea>
		  </div>
		</form>
	</div>
</body>
</html>